﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using Pai.LiveStation.Data;

namespace Pai.LiveStation.Web
{
    public static class RadioShowsHelper
    {
        public static RadioShow GetRadioShowFromID(int id)
        {
            using (RadioClassesDataContext dc = new RadioClassesDataContext())
            {
                return dc.RadioShows.Where(x => x.ID == id).FirstOrDefault();
            }
        }
        public static RadioShow GetRadioShowFromName(string name)
        {
            using (RadioClassesDataContext dc = new RadioClassesDataContext())
            {
                return dc.RadioShows.Where(x => x.Name.Equals(name.Replace('-', ' '))).FirstOrDefault();
            }
        }
    }
}